package cn.zcf.system.mapper;

import cn.zcf.system.domain.Role;
import cn.zcf.system.query.RoleQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper{
    List<Role> loadAll();
    Role loadById(Long id);

    List<Role> queryData(RoleQuery query);
    Integer queryCount(RoleQuery query);

    void removeRolePermissionByRoldId(Long id);

    void removeRoleMenuByRoldId(Long id);

    void delete(Long id);
    //添加中间表信息：t_role_permission
    void saveRolePermissons(@Param("roleId")Long roleId, @Param("permissions")List<Long> permissions);
    //添加中间表信息：t_role_menu
    void saveRoleMenus(@Param("roleId")Long roleId, @Param("menus")List<Long> menus);

    void update(Role role);

    void save(Role role);
}
